<template>
<!--展示关注和粉丝组件-->
  <div class="userAvatar">
    <img :src="avatar.avatarUrl" alt />
    <p>{{avatar.nickname}}</p>
    <p class="munber">{{avatar.followeds}}人关注</p>
    <slot name="text">
      <span>已关注</span>
    </slot>
  </div>
</template>

<script>
export default {
  name: "userAvatar",
  props: ["avatar"],
  mounted() {
      //console.log(this.avatar)
  }
};
</script>

<style scoped lang='less'>
.userAvatar {
  width: 140px;
  display: inline-block;
  text-align: center;
  img {
    width: 100%;
    border-radius: 50%;
  }
  p {
    font-family: "Courier New", Courier, monospace;
    margin: 5px 0px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  p.munber {
    font-size: 14px;
    color: #999;
  }
  span {
    font-size: 14px;
    white-space: nowrap;
  }
}
</style>